Dynomotion

Group: DynoMotion Message: 12572 From: cnc_machines Date: 12/7/2015
Subject: Spindle Stop
Greetings,

I am having an issue getting my spindle to stop moving when I have a following error on one of my axis. Axis 0 and 1 are part of coordinated motion, 2 is not. It runs the spindle through a separate program. I am using the following code which is part of the loop forever INIT file.

//turn off spindle for following errors
if ((HadFollowingError(ch0) || HadFollowingError(ch1) )))
{
Jog(2,0); //stop the spindle
SetBit(57); //Turn on red light
}

It is strange because it will turn the red light on, but it will not stop the spindle. The spindle will stop however as soon as I home channel 0 and 1 to clear the following error. It seems like the command is on hold until the following error is cleared or something.

Does anyone have an idea what could be going on? Any ideas how to halt channel 2 if the others error?

Thanks,

Scott


Group: DynoMotion Message: 12573 From: Moray Cuthill Date: 12/7/2015
Subject: Re: Spindle Stop
You say your spindle is controlled by another program. Do you mean another thread?

If it's controlled by another thread, then both threads will most likely be fighting over control of the channel. One will be telling it to stop, then the other will be telling it to keep going.
You probably want to implement some form of global variable, that the spindle program monitors. In fact, you could probably just monitor bit 57.

Moray

On Tue, Dec 8, 2015 at 12:01 AM, cnc_machines@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Greetings,

I am having an issue getting my spindle to stop moving when I have a following error on one of my axis. Axis 0 and 1 are part of coordinated motion, 2 is not. It runs the spindle through a separate program. I am using the following code which is part of the loop forever INIT file.

//turn off spindle for following errors
if ((HadFollowingError(ch0) || HadFollowingError(ch1) )))
{
Jog(2,0); //stop the spindle
SetBit(57); //Turn on red light
}

It is strange because it will turn the red light on, but it will not stop the spindle. The spindle will stop however as soon as I home channel 0 and 1 to clear the following error. It seems like the command is on hold until the following error is cleared or something.

Does anyone have an idea what could be going on? Any ideas how to halt channel 2 if the others error?

Thanks,

Scott



Group: DynoMotion Message: 12576 From: Hardy Family Date: 12/7/2015
Subject: Re: Spindle Stop
I take it you are using axis 2 as a step/direction spindle roller.  Have you dried using DisableAxis(2) instead of Jog(2,0)?

Note that you have 1 too many close parens on the if test.  Maybe an error transcribing the code to email?

Also you might like to post the code for HadFollowingError().  Normally, if the axis gets a following error, the axis is automatically disabled by the firmware.  In that case, chan[n].Enable will be set back to 0.  Is that the test you are using?

Regards,
SJH


On Mon, Dec 7, 2015 at 4:01 PM, cnc_machines@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Greetings,

I am having an issue getting my spindle to stop moving when I have a following error on one of my axis. Axis 0 and 1 are part of coordinated motion, 2 is not. It runs the spindle through a separate program. I am using the following code which is part of the loop forever INIT file.

//turn off spindle for following errors
if ((HadFollowingError(ch0) || HadFollowingError(ch1) )))
{
Jog(2,0); //stop the spindle
SetBit(57); //Turn on red light
}

It is strange because it will turn the red light on, but it will not stop the spindle. The spindle will stop however as soon as I home channel 0 and 1 to clear the following error. It seems like the command is on hold until the following error is cleared or something.

Does anyone have an idea what could be going on? Any ideas how to halt channel 2 if the others error?

Thanks,

Scott